#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;





bool CheckStringInt(string s) //This inputs a string and returns true if the string is int-compatible, and false if the string cannot be turned into an int
{
    bool still_int = true;

  for(int i = 0; (i < s.length() )&&(still_int == true); i++)
  {
    if ((s[i] == ('0'))||(s[i] == ('1'))||(s[i] == ('2'))||(s[i] == ('3'))||(s[i] == ('4'))||(s[i] == ('5'))||(s[i] == ('6'))||(s[i] == ('7'))||(s[i] == ('8'))||(s[i] == ('9')))
    {
    }
    else
    {
        still_int = false;
    }
  }
  return still_int;
}

int StringToInt(string s) //This inputs a string and returns an int

{
    int output = 0;

      for(int i = s.length();i > 0 ; i--)
        {
        output += (s[i-1]-48)*pow(double(10),double(s.length()-i)); //add double definition, pow need double type --archie
        }
  return output;
}

/*used to debug this

int main(){
    while(true){
cout << "Type in a query\n";
string query = "query";
cin >> query;
cout << CheckStringInt(query);
cout << "\nThis returns if the query is integer-compatible\n\n";
if (CheckStringInt(query)){
cout << StringToInt(query);
cout << "\nThis String has Int Swaqqq\n\n\n\n";
}
else{
cout << "\nThis String be a String\n\n\n\n";
}
}
return 0;
}*/ //add comment close symbol --Archie
